﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Pay.Data {
	public partial class PlatBillDetailMap
		: System.Data.Entity.ModelConfiguration.EntityTypeConfiguration<PlatBillDetail> {
		public PlatBillDetailMap() {
			// table
			ToTable("mc_PlatBillDetail", "dbo");

			// keys
			HasKey(t => t.Id);

			// Properties
			Property(t => t.Id)
				.HasColumnName("Id")
				.HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity)
				.IsRequired();
			Property(t => t.PlatBillId)
				.HasColumnName("PlatBillId")
				.IsRequired();
			Property(t => t.BillType)
				.HasColumnName("BillType")
				.IsRequired();
			Property(t => t.Amount)
				.HasColumnName("Amount")
				.HasPrecision(18, 6)
				.IsRequired();
			Property(t => t.Balance)
				.HasColumnName("Balance")
				.HasPrecision(18, 6)
				.IsRequired();
			Property(t => t.Status)
				.HasColumnName("Status")
				.IsRequired();
			Property(t => t.CreateTime)
				.HasColumnName("CreateTime")
				.IsRequired();

			// Relationships
			HasRequired(t => t.PlatBill)
				.WithMany()
				.HasForeignKey(d => d.PlatBillId)
				.WillCascadeOnDelete(false);
			HasRequired(t => t.PayInfo)
				.WithMany()
				.HasForeignKey(d => d.PayId)
				.WillCascadeOnDelete(false);
		}
	}
}